/**
 * 
 */
package com.planner.core.action.node;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.juli.logging.Log;
import org.apache.juli.logging.LogFactory;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.india.StopNode;
import com.planner.core.action.node.form.NodeDetailForm;
import com.planner.core.dao.NodeNotFoundException;

/**
 * @author Sangharsh
 *
 */
public class EditNodeAction extends AbstractNodeAction {
	
	private static final Log LOG = LogFactory.getLog(EditNodeAction.class);
	
	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response) throws NodeNotFoundException{
		NodeDetailForm detailForm = (NodeDetailForm)form;
		StopNode node = stopService.getNode(detailForm.getId());
		LOG.info(node);
		detailForm.setFormData(node);
		LOG.info("Executing Action EditNodeAction");
		return mapping.findForward(SUCCESS_FORWARD);
	}
	
}
